#include "GameEngine.h"
#include "../physics/bodies/RectangleBody.h"
#include <cmath>


GameEngine::GameEngine() {
	this->render = new Render();
	this->world = new PhysicWorld(new Point(0, -0));
}

GameEngine::~GameEngine() {
	delete render;
	delete bodyMapingShape;
	delete world;
	delete elapsedTimer;
}

void GameEngine::init() {
	this->render->init();
}

void GameEngine::loopGame() {
	float t = elapsedTimer->elapsed();
	elapsedTimer->restart();
	this->doKeyEvent();
	this->world->update(t);
	this->updateShapeStatusFormBody();
	this->render->render();
}

void GameEngine::doKeyEvent() {
}

void GameEngine::keyReleaseEvent(QKeyEvent* event) {

}
void GameEngine::keyPressEvent(QKeyEvent* event) {

}
